1. Field of the Invention
The present invention relates generally to integrated circuits, and more particularly to methods and apparatus for memory allocation within integrated circuits.
2. Background
An integrated circuit (IC), such as a system on a chip (SOC), may include a processing unit (e.g., a processor) which includes a subsystem (e.g., an internal memory). The processor may access the subsystem to execute an instruction or read and write data.
The IC may include one or more direct memory access (DMA) machines coupled to the processor. The DMA machines may also access the subsystem of the processor to load (e.g., preload) code or data into the subsystem before the processor executes an instruction which requires the code or data.
An application running on the IC may have a time budget that requires one or more of the DMA machines to load code and/or data into the subsystem, and the processor to execute instructions within allotted times, respectively. If one or more of the DMA machines does not load (e.g., preload) code or data, which is required by instructions to be executed by the processor, into the subsystem within the allotted time, the IC fails and the application is non-operative. Similarly, if the processor does not execute an instruction within the allotted time, the IC fails and the application is non-operative.
According to one scheme, a fixed priority may be assigned to the processor and one or more of the DMA machines. A task received from the highest-priority processor or DMA machine may be completed before other tasks. If all DMA machines are assigned a higher priority than the processor, the tasks of all the DMA machines are completed before any processor tasks. In such a system, a processor task will eventually fail to be completed within an allotted time. Alternatively, if the processor is assigned a higher priority than the DMA machines, all the processor tasks are always completed before any tasks of the DMA machines. In such a system, one or more DMA machines' tasks will eventually fail to be completed within the allotted time. For example, one or more of the DMA machines may fail to load data into the subsystem of the processor before execution of the instructions that require the data.
Because the processor and one or more DMA machines must access the subsystem to complete tasks, respectively, within the allotted times, a method of allocating priority between the processor and the one or more DMA machines is needed.